from OpenGL.GL import *
import pyglet

from game.core.gamemanager import GameManager

class LoadingScreen(object):
	"""
	This class represents the game's loading screen.
	"""
	
	def __init__(self):
		self.loading_text = pyglet.text.Label('Loading...', font_size=22,
								x=GameManager.main_window.win.width / 2,
								y=GameManager.main_window.win.height / 2 - 200,
								anchor_x='center', anchor_y='center')
		
		img = pyglet.image.load('../data/images/main_menu/logo.png')
		img.anchor_x = img.width / 2
		self.logo = pyglet.sprite.Sprite(img,
							x=GameManager.main_window.win.width / 2,
							y=GameManager.main_window.win.height / 2)
	
	def on_draw(self):
		glDisable(GL_LIGHTING)
		self.logo.draw()
		self.loading_text.draw()
		glEnable(GL_LIGHTING)
		